<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>08_事件委派-总结</title>
        <style>
            .outer {
                width: 500px;
                height: 500px;
                background-color: red;
            }

            .inner {
                width: 100px;
                height: 100px;
                background-color: aqua;
            }
        </style>
    </head>
    <body>
        <div class="outer">
            <div class="inner">

            </div>
        </div>
        
        <script>
            var outer = document.querySelector('.outer');

            outer.onclick = function(){
                console.log(1111111);
            }

            var inner = document.querySelector('.inner');

            inner.onclick = function(){
                console.log(22222);
            }
        </script>
    </body>
</html>